package com.wistech.search.solr.qp;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.Query;
import org.apache.solr.search.QParser;
import org.apache.solr.util.SolrPluginUtils.DisjunctionMaxQueryParser;

public class WisDisjunctionMaxQueryParser extends DisjunctionMaxQueryParser {

	public WisDisjunctionMaxQueryParser(QParser qp, String defaultField) {
		super(qp, defaultField);
	}

	@Override
	protected Query newFieldQuery(Analyzer analyzer, String field,
			String queryText, boolean quoted) throws ParseException {
		quoted = false;
		setAutoGeneratePhraseQueries(false);
		setDefaultOperator(AND_OPERATOR);
		return super.newFieldQuery(analyzer, field, queryText, quoted);
	}

}
